package com.jingxi.controller;

import com.jingxi.service.ImageUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

@Controller
public class ImageCotroller {
    @Autowired
    private ImageUploadService imageUploadService;
    @SuppressWarnings("rawtypes")
    @RequestMapping("/pic/upload")
    @ResponseBody
    public Map upload(MultipartFile uploadFile)throws Exception
    {
        Map imageResult=imageUploadService.uploadFile(uploadFile);
        return imageResult;
    }
}
